# -*- coding:UTF-8 -*-
import shutil

f_txt = open('/dssg/home/zhineng_qt/test_2021_3_18_fu/dataset2/test_voc/small_voc/all/main/train.txt', 'r')
f_train = '/dssg/home/zhineng_qt/test_2021_3_18_fu/dataset2/test_voc/small_voc/all/getsplit/train'

context = list(f_txt)
for imagename in context:
    imagename = imagename[0:6]
    imagename = imagename + '.jpg'
    imagepath = '/dssg/home/zhineng_qt/test_2021_3_18_fu/dataset2/test_voc/small_voc/all/images/'+ imagename
    shutil.copy(imagepath,f_train)
    # 删除训练集和验证集，剩余图片为测试集
    # os.remove(imagepath)

#处理Annotations同理只需将.jpg改为.xml